package com.zzg.srb.core.controller.api;


import com.zzg.srb.common.result.R;
import com.zzg.srb.core.service.DictService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiOperation;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;

import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import java.util.List;

/**
 * <p>
 * 数据字典 前端控制器
 * </p>
 *
 * @author zhengzg
 * @since 2022-05-27
 */
@RestController
@RequestMapping("/api/core/dict")
@Api(tags = "数据字典表")
public class DictController {

    private Logger log = LoggerFactory.getLogger(DictController.class);

    @Resource
    private DictService dictService;

    @ApiOperation("根据dictCode获取下级节点")
    @GetMapping("/findByDictCode/{dictCode}")
    @ApiImplicitParam(name = "dictCode",value = "节点编码",required = true)
    public R findByDictCode(@PathVariable String dictCode){

        return R.ok().data(dictService.findByDictCode(dictCode));
    }

}

